package com.itheima.test;

import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody;
import com.aliyun.teaopenapi.models.Config;

public class Sample {


    public static void main(String[] args_) throws Exception {

        String accessKeyId = "LTAI4GKgob9vZ53k2SZdyAC7";
        String accessKeySecret= "LHLBvXmILRoyw0niRSBuXBZewQ30la";
        Config config = new Config()

                .setAccessKeyId(accessKeyId)

                .setAccessKeySecret(accessKeySecret);
        config.endpoint = "dysmsapi.aliyuncs.com";

        com.aliyun.dysmsapi20170525.Client client =  new com.aliyun.dysmsapi20170525.Client(config);

        SendSmsRequest sendSmsRequest = new SendSmsRequest()
                .setPhoneNumbers("13612345678")
                .setSignName("阿里云短信测试")
                .setTemplateCode("SMS_205134115")
                .setTemplateParam("{code:1234}");
        SendSmsResponse response = client.sendSms(sendSmsRequest);
        SendSmsResponseBody body = response.getBody();

    }
}